#include <iostream>
#include <unordered_map>
#include <algorithm>

using namespace std;

const int N = 3e5 + 10;

//typedef pair<int, int> PII;

struct node{
	int x, num;
}a[N];

unordered_map<int, int> mp;

int n;

bool cmp(node& x, node& y)
{
	return x.x > y.x;
}

int main()
{
	cin >> n;
	for(int i = 1; i <= n; i++) 
	{
		int x; cin >> x; 
		a[i].x = x; a[i].num = i;
		mp[x]++;
	}
	sort(a + 1, a + 1 + n, cmp);
	for(int i = 1; i <= n; i++)
	{
//		cout << a[i].x << endl;
		if(mp[a[i].x] == 1) 
		{
			cout << a[i].num << endl;
			return 0;
		}
	}
	cout << -1 << endl;
	return 0;
}
